<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

<style>
    #iddiv{
        background-color: blue;
    }
    .cdiv{
        background-color: red;
    }
    div{
        background-color: yellow;
    }

    /* id选择器权重>class>元素 */
    div.pclass{
        background-color: wheat;
    }

    div p{
        background-color: green;
    }

    p{
        background-color: orange;
    }
</style>

</head>
<body>
    <div class="cdiv" id="iddiv" style="background-color: pink;">
        111
        <p class="pclass">222</p>
    </div>

    <p>333</p>
</body>
</html>